import java.util.Arrays;

public class ArrayDemo {
	public static void main(String[] args) {
		int[] arr = { 1,4,7,8,9,12,16,17,19,23};
		//在索引为4的位置添加元素  13
		int[] newArr = new int[arr.length + 1];
		newArr[4] = 13;
		System.arraycopy(arr, 0, newArr, 0, 4);
		System.arraycopy(arr, 4, newArr, 5, 6);
		System.out.println(Arrays.toString(newArr));
		int[] newArr1 = new int[arr.length - 1];
		System.arraycopy(arr, 0, newArr1, 0, 4);
		System.arraycopy(arr, 5, newArr1, 4, 5);
		System.out.println(Arrays.toString(newArr1));
		for(int i=0;i<6;i++){    
		    int k=++i;  
		    while(k<5){    
		        System.out.print(i);
		        break;
		    }
		} 
	}
}
